<%-- 
    Document   : novo
    Created on : 08/11/2008, 18:22:49
    Author     : Alan Almeida
--%>

<%@page contentType="text/html"%>
<%@page pageEncoding="UTF-8"%>
<%@taglib prefix="f" uri="http://java.sun.com/jsf/core" %>
<%@taglib prefix="h" uri="http://java.sun.com/jsf/html" %>
<%@taglib prefix="x" uri="http://java.sun.com/jsp/jstl/xml" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@taglib prefix="a4j" uri="http://richfaces.org/a4j" %>  
<%@taglib prefix="rich" uri="http://richfaces.org/rich" %>

<html>
<head>
    <title>nova reserva</title>
    <link rel="stylesheet" type="text/css" href="../css/estilo.css">
</head>
<body>
    <f:view>
        <div align="center">
        <h:form>
            <rich:panel style="width: 35%;" styleClass="fonte">
            <f:facet name="header">
                <h:outputLabel value="Novo reserva" />
            </f:facet>
            <h:panelGrid columns="3" styleClass="fonte">
                <h:outputLabel for="dataReserva" value="Data Reserva: " />
                <h:inputText id="dataReserva" value="#{reservaBean.reservaPojo.dataReserva}" size="15" styleClass="input" required="true" requiredMessage="Campo obrigatório." >
                    <f:convertDateTime pattern="dd/MM/yyyy" />
                </h:inputText>
                <rich:message for="dataReserva" styleClass="erro" />
                
                <h:outputLabel for="dataPrevista" value="Data Prevista: " />
                <h:inputText id="dataPrevista" value="#{reservaBean.reservaPojo.dataPrevista}" size="15" styleClass="input" required="true" requiredMessage="Campo obrigatório." >
                    <f:convertDateTime pattern="dd/MM/yyyy" />
                </h:inputText>    
                <rich:message for="dataPrevista" styleClass="erro" />
                
                <h:outputLabel for="Livro" value="Livro: " />
                <h:selectOneMenu id="Livro" required="true" value="#{reservaBean.reservaPojo.livro}" >
                    <f:selectItems value="#{livroBean.comboLivros}" />
                    <f:converter converterId="livroConverter" />
                </h:selectOneMenu>
                <rich:message for="Livro" styleClass="erro" />
                
                <h:outputLabel for="Usuario" value="Usuario: " />
                <h:selectOneMenu id="Usuario" required="true" value="#{reservaBean.reservaPojo.usuario}" >
                    <f:selectItems value="#{usuarioBean.comboUsuarios}" />
                    <f:converter converterId="usuarioConverter" />
                </h:selectOneMenu>
                <rich:message for="Usuario" styleClass="erro" />
            </h:panelGrid>
            <h:commandButton id="btnConfirmar" value="Confirmar" style="width: 15%;" action="#{reservaBean.salvar}" />
            </rich:panel>
        </h:form>
        <h:form>
            <h:commandButton id="btnVoltar" value="Voltar" style="width: 15%;" action="#{reservaBean.gotoListaReservas}" />
        </h:form>
        </div>
    </f:view>    
</body>
</html>
